#ifndef __MEM_H__
#define __MEM_H__

#include "stdint.h"
#include "stdbool.h"
struct mem_stat_str{
    struct pt   *thread;
};

void pt_system_heap_init(void *begin_addr, void *end_addr);
void * pt_malloc ( uint32_t size );
void * kernel_malloc ( uint32_t size );
void *pt_calloc(uint32_t count, uint32_t size);
void *pt_realloc(void *rmem, uint32_t newsize);
int32_t pt_free ( void * rmem );
bool is_heap_mem( void * rmem );
void pt_mem_no_warning(void);
uint32_t get_mem_remaining(void);
// 释放rmem同时将rmem置空
#define PT_FREE(rmem)  ( pt_free(rmem) == PT_EOK ? ( rmem = PT_NULL, PT_EOK): pt_free(rmem) )


#endif /* __MEM_H__ */
